package com.zdb.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Author Lx
 * @Date 2020/8/28 17:57
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@TableName(value = "zdb_pms_order_master")
public class OrderMaster {          //订餐订单表
    @TableId("order_id")
    private String id;                  //id
    @TableField("buyer_name")
    private String buyerName;           //买家名称
    @TableField( "buyer_phone")
    private String buyerPhone;          //买家电话
    @TableField("buyer_address")
    private String buyerAddress;        //买家地址
    @TableField("buyer_openid")
    private String buyerOpenid;         //买家微信的openid
    @TableField("order_amount")
    private String orderAmount;         //订单总金额
    @TableField("order_status")
    private String orderStatus;         //订单状态 , 默认0为新订单
    @TableField("pay_status")
    private String payStatus;           //支付状态 , 默认0为未支付
    @TableField("create_time")
    private String createTime ;         //创建时间
    @TableField("update_time")
    private String updateTime;          //修改时间
    @TableField("uid")
    private int uId;                    //用户id
    @TableField("sid")
    private int sId;                    //店铺id
    @TableField("buyer_remarks")
    private String buyerRemarks;        //点餐用户的备注
    @TableField("p_ids")
    private String pIds;                //商品id集合

    @TableField("pick_up_address")
    private String pickUpAddress;       //取餐地址
    @TableField("r_id")
    private String rId;                 //骑手地址


    @TableField(exist = false)
    private String sName;               //店铺name
    @TableField(exist = false)
    private String sPhotoAddress;       //店铺头像地址

//    @TableField(exist = false)
//    private List<ProductInfo> proInfos; //此订单包含的商品集合

    @TableField(exist = false)
    private List<OrderDetail> odInfos; //此订单包含其商品详情（一个订单下所有购买商品的相信信息）

    @TableField(exist = false)
    private Double orderTotalPrice;                     //此单总价格

    @Override
    public String toString() {
        return "OrderMaster{" +
                "id='" + id + '\'' +
                ", buyerName='" + buyerName + '\'' +
                ", buyerPhone='" + buyerPhone + '\'' +
                ", buyerAddress='" + buyerAddress + '\'' +
                ", buyerOpenid='" + buyerOpenid + '\'' +
                ", orderAmount='" + orderAmount + '\'' +
                ", orderStatus='" + orderStatus + '\'' +
                ", payStatus='" + payStatus + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", uId='" + uId + '\'' +
                ", sId='" + sId + '\'' +
                ", buyerRemarks='" + buyerRemarks + '\'' +
                ", pIds='" + pIds + '\'' +
                ", pickUpAddress='" + pickUpAddress + '\'' +
                ", rId='" + rId + '\'' +
                ", sName='" + sName + '\'' +
                ", sPhotoAddress='" + sPhotoAddress + '\'' +
                ", proInfos='" + odInfos + '\'' +
                ", orderTotalPrice='" + orderTotalPrice + '\'' +
                '}';
    }

//    public OrderMaster(String id, String payStatus, String rId) {
//        this.id = id;
//        this.payStatus = payStatus;
//        this.rId = rId;
//    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    public String getBuyerPhone() {
        return buyerPhone;
    }

    public void setBuyerPhone(String buyerPhone) {
        this.buyerPhone = buyerPhone;
    }

    public String getBuyerAddress() {
        return buyerAddress;
    }

    public void setBuyerAddress(String buyerAddress) {
        this.buyerAddress = buyerAddress;
    }

    public String getBuyerOpenid() {
        return buyerOpenid;
    }

    public void setBuyerOpenid(String buyerOpenid) {
        this.buyerOpenid = buyerOpenid;
    }

    public String getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(String orderAmount) {
        this.orderAmount = orderAmount;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(String payStatus) {
        this.payStatus = payStatus;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    public int getsId() {
        return sId;
    }

    public void setsId(int sId) {
        this.sId = sId;
    }

    public String getBuyerRemarks() {
        return buyerRemarks;
    }

    public void setBuyerRemarks(String buyerRemarks) {
        this.buyerRemarks = buyerRemarks;
    }

    public String getpIds() {
        return pIds;
    }

    public void setpIds(String pIds) {
        this.pIds = pIds;
    }

    public String getsName() {
        return sName;
    }

    public void setsName(String sName) {
        this.sName = sName;
    }

    public List<OrderDetail> getOdInfos() {
        return odInfos;
    }

    public void setOdInfos(List<OrderDetail> odInfos) {
        this.odInfos = odInfos;
    }

    public String getPickUpAddress() {
        return pickUpAddress;
    }

    public void setPickUpAddress(String pickUpAddress) {
        this.pickUpAddress = pickUpAddress;
    }

    public String getsPhotoAddress() {
        return sPhotoAddress;
    }

    public void setsPhotoAddress(String sPhotoAddress) {
        this.sPhotoAddress = sPhotoAddress;
    }

    public String getrId() {
        return rId;
    }

    public void setrId(String rId) {
        this.rId = rId;
    }

    public Double getOrderTotalPrice() {
        return orderTotalPrice;
    }

    public void setOrderTotalPrice(Double orderTotalPrice) {
        this.orderTotalPrice = orderTotalPrice;
    }
}
